package xkp.lesson4;

public class Person{
	private String name;
	private int age;
	private String birthday;
	//构造方法的格式(**********)
//	访问修饰符 类名称(参数列表) {
//		方法体
//		//无返回值
//		//访问修饰符合类名称之间不能有返回值类型包括void
//	}
	
	
	/*
	 * public Person(int age) { this.age = age; }
	 */
	public Person() {
		System.out.println("Person ");
	}
	
	
	

	public Person(int age) {
		this.age = age;
	}




	public Person(String name) {
		this.name = name;
	}




	public Person(int age, String name) {
		this.age = age;
		this.name = name;
	}




	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getName() {
		return name==null?"":name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		if(age > 150 || age <0) {
			System.out.println("年龄有误，请重新设置");
			return;
		}
		this.age = age;
	}

}
